import java.io.*;

public class Test8 {
    public static void main(String[] args) throws IOException {

        String fileName = "D:\\Java\\try.dat";

        DataOutputStream out = new DataOutputStream(new FileOutputStream(fileName));

        out.writeByte(-1);
        out.close();

        DataInputStream in = new DataInputStream(new FileInputStream(fileName));

        int a = in.readByte();

        System.out.println(a);
    }
}
